#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    resize(QT_WIDTH, QT_HEIGHT);
    QPixmap ceBianLanImg("..\\weChat\\images\\ceBianLan.png");
    ui->leftBgLabel->setFixedSize(57, QT_HEIGHT);
    ui->leftBgLabel->setPixmap(ceBianLanImg); // 设置图片
    ui->leftBgLabel->setScaledContents(true); // 缩放图片以适应控件大小

    qDebug() << "Current directory:" << QDir::currentPath();
    qDebug() << "Image path:" << QDir("..\\weChat\\images\\searchIMG.png").absolutePath();
    QPixmap searchImg("..\\weChat\\images\\searchIMG.png");
    ui->centerSearchLabel->setFixedSize(225, 62);
    if (!searchImg.isNull())
    {
        ui->centerSearchLabel->setPixmap(searchImg);    // 设置图片
        ui->centerSearchLabel->setScaledContents(true); // 缩放图片以适应控件大小
    }
    else
    {
        qWarning() << "Failed to load image!";
    }

    
}

MainWindow::~MainWindow()
{
    delete ui;
}
